<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>{$title}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no" />
<link href="{$Think.config.RESOURCEURL}wx_assets/css/webpage.css?v=20150121" rel="stylesheet" type="text/css">
<script src="{$Think.config.RESOURCEURL}wx_assets/js/jquery-1.7.1.min.js"></script>
<script src="{$Think.config.RESOURCEURL}wx_assets/js/alert.js" type="text/javascript"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/wx_share.js{$Think.config.RESOURCE_VER}"></script>
<script src="{$Think.config.RESOURCEURL}wx_assets/js/util.js{$Think.config.RESOURCE_VER}" type="text/javascript"></script>

    <style>
        #webpage .page-bizinfo {
            margin: 0;
        }
        .page-bizinfo {
            padding: 15px 10px;
        }
    </style>
</head>
<empty name="bgColor">
<body id="webpage">
<else />
<body id="webpage" style="background-color:{$bgColor};">
</empty>
	<div class="Listpage">
		<div class="page-bizinfo">
			<div class="header" style="position: relative;">
                <if condition="($isDisplayReadCount eq '1')">
	                <notempty name="createTime">
	                    <script>var time = '{$createTime}'; time = time.split(" ")[0]; document.write("<span id='post-date' style='font-size:15px;line-height:25px;'>" + time + "</span>");</script>
					<else />
						<script>var time = '{$updateTime}'; time = time.split(" ")[0]; document.write("<span id='post-date' style='font-size:15px;line-height:25px;'>" + time + "</span>");</script>
					</notempty>
	               <notempty name="author">
	                       <span id='post-author' style='padding-left:10px;font-size:15px;color:#8c8c8c;'>{$author}</span>
	               </notempty>
	               <notempty name="weixinName">
	                 	<notempty name="focusLink">
	                    	<a id='post-author' style='font-size:15px;color:#607fa6;padding-left:10px' href="{$focusLink}">{$weixinName}</a>
	                    <else />
	                    	<span id='post-author' style='font-size:15px;color:#8c8c8c;padding-left:10px'>{$weixinName}</span>
	                    </notempty>
	                </notempty>
                    <notempty name="repostCount">
                        <span class="repost">转发阅读数:{$repostCount}</span>
                    </notempty>
                </if>

				<if condition="($rate eq '1')">
					<span class="spr star">
						<script>var level = '{$rateCount}'; var classname = 'w' + level + ' spr'; document.write("<a class='" + classname + "'></a>");</script>
					</span>
				</if>
			</div>
			<div class="text" id="content">{$content}</div>
            <if condition="($isDisplayReadCount eq '1')">
           		 <div class="text" style="padding-top:20px; font-size:11px;">阅读次数:{$readCount}</div>
            </if>
		</div>
		<div class="page-content"></div>
	</div>


	<notempty name="attachments">
	<div class="list">
		<div id=olattachment>
			<span>附件</span>
		</div>
		<div id="oldlist">
			<ul>
				<volist name="attachments" id="att">
				<li class="attmore"><a href="{$att.url}">
						<div class="attitem">
							<div class="title">{$att.attachmentName}</div>
						</div>
				</a></li>
				</volist>
			</ul>
		</div>
	</div>
	</notempty>
			
	<if condition="($comment eq '1' or $rate eq '1')">
	<div class="list">
		<div id="olcomment">
			<span>评论</span>
		</div>
		<notempty name="comments">
		<div id="oldlist">
			<ul>
				<volist name="comments" id="com">
					<li>
						<div id="uyan_cmt_list">
							<div id="uyan_cmt_9384592"
								style="border-top: 1px solid #D7D7D7; padding: 15px 0;">
								<div style="position: relative; float: left; border-radius: 6px 6px 6px 6px; width: 50px; height: 50px; margin-right: 10px;">
									 <img
										style="border: 0 none; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.22); border-radius: 4px; width: 50px; height: 50px;"
										src="wx_assets/images/webpage/face.png"								>
									<span style="bottom: -4px; position: absolute; right: -5px;"></span>
								</div>
								<div style="padding-left: 80px;">
									<div style="color: #303030; font-size: 13px; line-height: 18px; height: 20px;">
										<script>
										var fullName = '{$com.fullName}';
										if(fullName != '') {
											document.write("<span style='font-weight: bold; color: #2B8CE6; float: left; text-decoration: none; padding-right: 6px;'>{$com.fullName}</span>");
										} else {
											document.write("<span class='uyan_cmt_ufromname' style='color: #aaaaaa; float: left;'>游客</span>");
										}
										</script>
										<div id="uyan_star_9384592" style="float: right; display: none;"></div>
									</div>
									<div class="uyan_cmt_txt"
										style="color: #303030; font-size: 13px; line-height: 18px; word-wrap: break-word; text-align: left;">{$com.comment}</div>
									<div class="uyan_cmt_exp"
										style="padding: 5px 5px 0 0; line-height: 14px;">
										<div style="color: #999999; float: left; font-size: 11px; padding: 0 10px 0 0;">{$com.updateTime}</div>
										<div style="clear: both;"></div>
									</div>
								</div>
								<div style="clear: both;"></div>
							</div>
						</div>
					</li>
				</volist>
			</ul>
		</div>
		</notempty>
		<div>
				<if condition="($comment eq '1' AND $alreadyComment eq 0) OR ($rate eq '1' AND $alreadyRate eq 0)">
				<div id="comment">
					<span>发布评论</span>
				</div>
				</if>
				<if condition="($rate eq '1' AND $alreadyRate eq 0)">
				<ul id="rate_star" >
				  <li></li>
				  <li></li>
				  <li></li>
				  <li></li>
				  <li></li>
				</ul>
				</if>
				
				<if condition="($comment eq '1' AND $alreadyComment eq 0)">
				<textarea id="comment_textarea"></textarea>
				<div id="uyan_stat_btn"
					style="position: relative; overflow: hidden; margin-bottom: 5px; margin-top: 0px; line-height: 15px;">
					<div
						style="font-size: 12px; float: right; margin-top: 5px; width: 72px;">
						<a id="uyan_cmt_btn" onclick="onComment();"
							style="cursor: pointer; font-family: 'Microsoft YaHei', arial, tahoma, 宋体, sans-serif; padding: 0px;
							 border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; 
							 border-bottom-left-radius: 3px; color: rgb(102, 102, 102); display: inline-block; font-weight: 600; 
							 text-shadow: rgba(255, 255, 255, 0.597656) 0px 1px 0px; float: right; 
							 background-image: url(http://v2.uyan.cc/code/images/buttonLarge.png); background-attachment: scroll; 
							 background-color: transparent; text-align: center; width: 70px; border: 1px solid rgb(184, 184, 184);
							 font-size: 12px; line-height: 22px; height: 22px; background-position: 0px 0px;
							 background-repeat: repeat no-repeat;">提&nbsp;&nbsp;交</a>
					</div>
					<div id="uyan_vis"
						style="float: right; margin-right: 10px; min-height: 32px; padding-left: 5px; width: 116px;">
						<p id="uyan_lb_uname"
							style="height: 26px; text-indent: 0; margin: 5px 0 0px; width: 100px; padding: 0;">
							<input maxlength="20" id="uyan_l_uname"
								type="text" value="{$fullName}"
								style="font-family: 'Microsoft YaHei', arial, tahoma, 宋体, sans-serif; background-color: rgba(255, 255, 255, 0.449219);
								border: 1px solid rgb(184, 184, 184); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;
								border-bottom-left-radius: 3px; box-shadow: rgba(0, 0, 0, 0.117188) 0px 1px 3px inset; font-size: 12px; 
								height: 22px; line-height: 22px; margin: 0px; padding: 0px 8px; width: 100%; vertical-align: top; 
								color: rgb(153, 153, 153); background-repeat: repeat no-repeat;">
						</p>
					</div>
					<div style="float:right;"><p style="font-size:12px; color:#535353; margin: 10px 0 0px; padding: 0;">昵称：</p></div>
					<div style="clear: both;"></div>
				</div>
			</if>
		</div>
	</div>
	</if>

	<!-- 
		<a class="footer" href="" target="_self"><span class="top">返回顶部</span></a>
	 -->

	<script>
	var id = {$id};
	var hrefParamsArray = GetSessionIdFromHref(window.location.search);
	
	function GetSessionIdFromHref(search){
	　　	var args = search.substring(1); 
	　　	var retval = new Array(); 
		args = args.split("&"); 
			for(var i = 0; i < args.length; i ++){ 
				str = args[i]; 
				var arg = str.split("="); 
				if(arg.length <= 1) continue; 
				if(arg[0] == 'customerId') {
					retval["customerId"] = arg[1]; 
				}else if(arg[0] == 'userName'){
					retval["userName"] = arg[1]; 
				}
			} 
			return retval; 
	}
		
	function onComment() {
		var comment = $('#comment_textarea').val();
		if (comment == '') {
			return;
		}
		
		var baseUrl =  '{$Think.config.SERVER_HOST}';
		var urlString = baseUrl + 'call.json?customerId='+ hrefParamsArray["customerId"]+'&userName='+hrefParamsArray["userName"];
		var fullName = $('#uyan_l_uname').val();
	
		$.ajax({url : urlString,
				dataType : "json",
				type : "post",
				data : {
					'module': 'webPage',
			        'method' : 'comment',
			        'params' : '{"id":' + id + ',"fullName":"' + fullName + '","comment":"' + comment + '"}'
				},
				success : function(data) {
					try {
						if (data.code) {
							alert(data.msg);
						}
					} catch (e) {
						window.location.reload();
					}
				},
				error : function() {
				}
			});
	}
		
	function onRate(rate) {
		var baseUrl =  '{$Think.config.SERVER_HOST}';
		var urlString = baseUrl + 'call.json?customerId='+ hrefParamsArray["customerId"]+'&userName='+hrefParamsArray["userName"];
	
		$.ajax({url : urlString,
				dataType : "json",
				type : "post",
				data : {
					'module': 'webPage',
			        'method' : 'rate',
			        'params' : '{"id":' + id + ',"rate":"' + rate + '"}'
				},
				success : function(data) {
					try {
						if (data.code) {
							alert(data.msg);
						}
					} catch (e) {
						window.location.reload();
					}
				},
				error : function() {
				}
			});
	}
		 
	(function() {
		$('#rate_star').on('click','li',function() {
			var num = $(this).index() + 1;
			var width = num * 24 + "px";
			$('#rate_star').css("width",  width);
			$('#rate_star').css("background-position","0 0");
			onRate(num);
		});

		var search = '?' + resetAndAppendHerf(window.location.search);
		var link = window.location.protocol + "//"
					+ window.location.host + window.location.pathname + search;
	
		
		var title = '{$title}', desc = '{$description}',
		imgUrl = '{$picurl}';
	})();
	
	function resetAndAppendHerf(search){
	　　	var args = search.substring(1); 
	　　	var retval = new Array(); 
		args = args.split("&"); 
		for(var i = 0; i < args.length; i ++){ 
			str = args[i]; 
			var arg = str.split("="); 
			if(arg.length <= 1) continue; 
			if(arg[0] == 'userName'){
				args[i] = "userName=";
			}
			if (arg[0] == 'params') {
				if (hrefParamsArray["userName"] != '') {
					var sourceUserName = ",%22srcUserName%22:%22" + hrefParamsArray["userName"] + "%22";
					args[i] = "params=%7B%22id%22:" + id  + sourceUserName + "%7D";	
				}
			}
		} 
		return args.join("&");
	}
	 wx_share.init({
        "title":"{$title}",
        "desc":'{$description}',
        "link":location.href,
        "imgUrl":"{$picurl}",
        "pkg":{
            "appId": '{$pkg.appId}',
            "timestamp": {$pkg.timestamp},
            "nonceStr": '{$pkg.nonceStr}',
            "signature": '{$pkg.signature}'
        },
        success:function(config,shareType){
            
        }
    });
	</script>
	<div style="display: none"></div>
</body>
</html>